Repository navigation
Fix Storybook story ID lookup in macOS stills capture - #14216
astracat-bot[bot] wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis ReportPackage size: no published package changed; no new dependencies. Not run on this PR: add CI impact: 0 job-min per update · pool 0% · standard runners · 2 CI action or script files changed (not measured)
Not measured (the jobs that use these keep their recent minutes above): .github/scripts/chrome-macos-stills.mjs, .github/scripts/chrome-macos-stills.test.mjs. Assumptions: before is each job's average over the last 20 pull-request runs; after keeps that for unchanged jobs and uses this run's minutes for added or changed ones, weighted by how often each changed job ran in those runs; runs a day averages the seven whole days before today; time to green compares this run with the median of those runs that ran the same jobs.
Generated by PR Enrichment workflow | View full report |
There was a problem hiding this comment.
Requesting changes: the helper fix looks right, but the description needs two corrections before approval.
- Add a
CI impact:line to the Evidence section, which the CI spec requires for any change to a CI script (for example: no pull-request job changes, since only the dispatch-onlystillsjob on macos-15 runs this helper, so job-minutes per update, runner-pool usage and time to green are unchanged). - Correct the overlap note: #14208 changes
chrome-macos-stills.mjs(its entry check), notchrome-macos-stills.test.mjs.
The stills tests passed when run locally (19 of 19), and a stubbed-browser run of capture and report matched the described resolution, fail-fast and exit-code behavior. #14209 rewrites the same capture loop, so whichever of the two lands second needs a rebase.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Title, the stills capture now resolves Storybook story IDs: verified (helper lines 117-135 and 207; local stubbed run).
- The stills tests pass, 19 of them: verified (run locally, 19 passed).
- A Linux headless capture went from 8 of 12 to 12 of 12 cells with the patch: reported.
- The earlier macOS dispatch captured 8 of 12 cells and its report failed the job: reported (its public job record shows the report step failed).
- Storybook names the two stories
core-segmentedcontrol--defaultandcore-textinput--default: verified (story titlesCore/SegmentedControlandCore/TextInput). - Every requested head cell still needs a screenshot, and a missing base cell does not fail the report: verified (helper lines 322-323; local stubbed run exited 1 and 0).
- An ID that cannot resolve to one story stays a per-cell failure: verified (per-cell try, ambiguity test, local stubbed run).
- IDs resolve against each build's index before a page opens, exact match first, otherwise one match that differs only in hyphens before the story separator, never another variant: verified (helper lines 119-129, 189-194 and 207; tests).
- The requested key still names the file and the report entry, and the JSON records the resolved ID when it differs: verified (helper lines 219-224; local stubbed run).
- Unknown or ambiguous IDs fail without waiting for a browser selector: verified (local stubbed run opened no page for them).
- Replays and a fresh build reproduced the failure, and the patched run captured all 12 cells with the eight earlier images byte-identical: reported.
- The tests cover exact-match precedence, both reported IDs, ambiguity and a misspelled story variant: verified (test lines 224-253, run locally).
- No component, story, runner or build changes, and branded Chrome is still selected on macOS: verified (two changed files; launch options and workflow unchanged).
- The macOS dispatch was not rerun, and the failed dispatch waited about two minutes per side: reported.
- Scope is the stills helper and its tests: verified.
- #14208 also changes the test file: false (it changes the helper).
- #14209 also changes the test file: verified.
.github/scripts/chrome-macos-stills.mjs: clear..github/scripts/chrome-macos-stills.test.mjs: clear.
|
This test passes on main now, but no commit on main touched it, so this PR stays open as the fix. |
|
validation: ran Resolved the merge conflict with #14209 by moving the existing The resulting merge keeps both implementations: resolve the story before opening the page, preserve the requested cell key and resolved-ID receipt, then use main's story-box readiness, scripted steps, and final focus check before the screenshot. All existing assertions are unchanged. The merged-tree suite's two inherited browser tests ran with Linux Chrome Headless Shell 158.0.8127.107 rather than Playwright's expected 149.0.7827.55, whose download was unavailable. These are supplemental checks; the branch's 19 tests and the conflict-free merge verify the declaration-only update. The branded macOS dispatch and full builds were not rerun. CI impact: no workflow or pull-request job changes; runner class, job-minutes per update, runner-pool usage, and time to green are unchanged. The existing |
|
This test passes on main now, but no commit on main touched it, so this PR stays open as the fix. |
There was a problem hiding this comment.
Approved pending CI: the fix reads right, and both corrections from the last round are in.
- The
CI impact:line now states what the CI spec asks for: the only job this helper runs in is the dispatch-onlystillsjob onmacos-15, a standard GitHub-hosted runner, and no pull-request job changes. - The overlap note is now correct: #14208 changes
chrome-macos-stills.mjs(its entry check), not the stills test file. - Worth a follow-up, not a blocker: the hyphen tolerance is invisible where a dispatcher meets it, since the workflow's
cellsinput and the cell-check error still describe only "a story id likecore-button--primary".
The stills tests pass here, 19 of 19, and a stubbed-browser run of capture and report matched the described behavior: resolution before any page opens, the requested key still naming the PNG and the report row, the resolved ID recorded in the JSON, and exit 1 for an uncaptured head cell against exit 0 for a missing base cell. #14209 has since merged into main, and the clean merge of main into this head passes that file's whole suite here, 59 of 59. The heavy suites (test, build and docsite-test) have not run at this head yet, so nothing is ready to merge until the review-pass run is green.
Claims and files checked
Review mode: full; reason: author-not-engowner
-
Title, the stills capture fixes Storybook story ID lookup: verified (helper lines 129-147 and 207; stubbed-browser run here).
-
The stills tests pass, 19 of them: verified (run here, 19 of 19).
-
Storybook builds the two requested stories as the compact IDs: verified (the story titles are Core/SegmentedControl and Core/TextInput).
-
IDs resolve against each build's index before a page opens, exact match first, otherwise the one match that differs only in hyphens before the story separator, never another variant: verified (helper lines 129-147, 189-194 and 207; the three resolveStory tests, run here).
-
The requested key still names the PNG and the report row, and the JSON records the resolved ID when it differs: verified (helper lines 219-224; the run here wrote core-segmented-control--default__1280x800.png and recorded the resolved ID beside it).
-
Unknown or ambiguous IDs fail without waiting for a browser selector: verified (the run here opened three pages for six cells and none for the three unresolvable ones).
-
Every requested head cell still needs a screenshot, and a missing base cell still does not fail the report: verified (helper line 323; the run here exited 1 with a failed head cell and 0 with none and no base).
-
The tests cover exact-match precedence, both reported IDs, ambiguity and a misspelled story variant: verified (test lines 224-253, run here).
-
No component or story source changes, no runner or build change, and branded Chrome is still selected on macOS: verified (two changed files; the launch options and the workflow are untouched).
-
CI impact: no pull-request job changes, so job-minutes per update, runner-pool usage and time to green are unchanged: verified (no workflow file changes; the only pull-request work added is three synchronous unit cases in the existing test job, 0 ms each here).
-
Scope is the stills capture helper and its tests: verified.
-
#14208 changes the entry check in the stills helper, not the stills test file: verified (its file list carries the helper and not the test file).
-
#14209 also changes this test file: verified; it has since merged into main, and the clean merge of main into this head passes that file's whole suite here, 59 of 59.
-
A Linux headless run went from 8 of 12 to 12 of 12 cells with the patch, with the eight earlier images byte-identical and the report exiting 0: reported (your run; not repeated here).
-
The earlier dispatch captured 8 of 12 cells and its report failed the job, and its four invalid cells waited about two minutes per capture side: reported.
-
The macOS dispatch was not rerun: reported.
-
The stills capture helper: clear.
-
Its test file: clear.
cixzhang
left a comment
There was a problem hiding this comment.
Approved at this exact head.
validation: ran
pnpm exec vitest run --project node .github/scripts/chrome-macos-stills.test.mjs(19 passed), the workflow’s Storybook build, and the capture and report commands on the original 12 cells using Linux Chrome Headless Shell 158.0.8127.107 in place of branded macOS Chrome 158.0.8127.108 (the unchanged helper captured 8/12 and exited 1; the patched helper captured 12/12 and exited 0).Maintainer impact
Run #7’s stills job captured 8 of 12 cells on both head and base. Both viewports timed out for each of two story IDs. The dispatch used
core-segmented-control--defaultandcore-text-input--default, but Storybook generatedcore-segmentedcontrol--defaultandcore-textinput--default. The report correctly failed the job for the missing head screenshots.Intended invariant
Every requested head cell still needs a screenshot. An ID that cannot be resolved uniquely remains a per-cell failure; a missing base cell still does not fail the report.
Change
Resolve the requested ID against each build’s Storybook index before opening a page. Prefer exact matches. Otherwise, accept a unique match that differs only in hyphenation before the story separator, without changing the story variant. Keep the requested cell key for the file and report, and record the resolved ID in JSON when it differs. Ambiguous or unknown IDs fail without waiting for a browser selector.
Evidence
stillsjob onmacos-15. No pull-request jobs change, so job-minutes per PR update, runner-pool usage for PRs, and time to green are unchanged.Scope
Stills capture helper and its tests only.
#14208 by cixzhang changes the entry check in
chrome-macos-stills.mjs, notchrome-macos-stills.test.mjs.#14209 by cixzhang also changes this test file.